import request from '@/utils/request.js'
import baseURL from '@/utils/config.js';

//获取书籍列表
export function getbookList(data) {
	return request({
		url: '/app/user/bookList',
		method: "GET",
		data
	})
}
//获取书籍分类列表
export function categoryList() {
	return request({
		url: '/app/user/categoryList',
		method: "GET"
	})
}
//获取轮播列表
export function carouselList() {
	return request({ 
		url: '/app/user/carouselList',
		method: "GET"
	})
}
//获取详情
export function getBookInfo(bookId) {
	return request({
		url: '/app/user/getBookInfo/'+bookId,
		method: "GET"
	})
}
//加入书架
export function addBookShelf(data) {
	return request({
		url: '/app/user/addBookShelf',
		method: "post",
		data
	})
}
//加入评价
export function addComment(data) {
	return request({
		url: '/app/user/addComment',
		method: "post",
		data
	})
}
//获取详情
export function getBookComments(bookId,data) {
	return request({
		url: '/app/user/getBookComments/'+bookId,
		method: "GET",
		data
	})
}
//获取书籍
export function selectBookShelfList(data) {
	return request({
		url: '/app/user/selectBookShelfList',
		method: "GET",
		data
	})
}
//删除书籍
export function delBookFromShelf(data) {
	return request({
		url: '/app/user/delBookFromShelf',
		method: "delete",
		data
	})
}
//检查关注状态
export function checkFollowStatus(userId) {
	return request({
		url: '/app/user/checkFollowStatus/'+userId,
		method: "GET",
	})
}
//关注
export function addfollow(data) {
	return request({
		url: '/app/user/follow',
		method: "post",
		data
	})
}
//取消关注
export function unFollow(data) {
	return request({
		url: '/app/user/unFollow',
		method: "put",
		data
	})
}
//删除评论
export function delComment(id) {
	return request({
		url: '/app/user/delComment/'+id,
		method: "delete",
	})
}
//获取浏览记录
export function selectBrowsingHistory(data) {
	return request({
		url: '/app/user/selectBrowsingHistory',
		method: "GET",
		data
	})
}
//获取粉丝列表
export function getMyFollowers(data) {
	return request({
		url: '/app/user/getMyFollowers',
		method: "GET",
		data
	})
}
//获取任务列表
export function gettaskList(data) {
	return request({
		url: '/app/user/taskList',
		method: "GET",
		data
	})
}
//完成任务
export function completionTask(data) {
	return request({
		url: '/app/user/completionTask',
		method: "post",
		data
	})
}
//获取我的评论列表
export function getMyComments(data) {
	return request({
		url: '/app/user/getMyComments',
		method: "GET",
		data
	})
}
//用户反馈
export function addFeedBack(data) {
	return request({
		url: '/app/user/addFeedBack',
		method: "post",
		data
	})
}
//修改用户信息
export function updateInfo(data) {
	return request({
		url: '/app/user/updateInfo',
		method: "put",
		data
	})
}
//兑换
export function goldCoinExchange(data) {
	return request({
		url: '/app/user/goldCoinExchange',
		method: "put",
		data
	})
}
//获取热门
export function getHotBooks(data) {
	return request({
		url: '/app/user/getHotBooks',
		method: "GET",
		data
	})
}